﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ArgumentBase.cs" company="JDML Consulting Ltd.">
//   Copyright 2011 Photon Project - http://photon.codeplex.com
// </copyright>
// <summary>
//   Defines the ArgumentBase type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Photon.Windows.Input
{
    using System;

    public abstract class ArgumentBase : AttachedObject<InvokeMethod>, IArgument
    {
        object IArgument.Evaluate(object context)
        {
            return Evaluate(context);
        }

        public event EventHandler RequerySuggested;
        
        protected abstract object Evaluate(object context);

        protected void RaiseRequerySuggested()
        {
            if (RequerySuggested != null)
            {
                RequerySuggested(this, EventArgs.Empty);
            }
        }
    }
}